#ifndef BUFFER_H_
#define	BUFFER_H_

#define FINISH_NOT_SEND 0
#define FINISH_SEND 	1
#define UNFINISH 		2
#define FREE			3

#define COMMAND_STATUS_SIZE 16

struct command_status_entry{
	unsigned int cmdSlotTag;
	unsigned int bufEntry;
	unsigned int status;
};

struct command_status{
	struct command_status_entry command_status_entry[COMMAND_STATUS_SIZE];
};

int init_buffer();
int push_to_buffer(unsigned int cmdSlotTag, unsigned int bufEntry);
int check_buffer();
int send_all_buffer();
int mark_buffer(unsigned int index, unsigned int status);
int exe_lowlevel();

#endif
